package com.lins.saas.service.impl;

import com.lins.common.mp.service.BaseServiceImpl;
import com.lins.saas.common.dto.SysTenantDto;
import com.lins.saas.mapper.SysTenantMapper;
import com.lins.saas.model.SysTenant;
import com.lins.saas.service.SysTenantService;
import org.modelmapper.ModelMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author linsir
 * @title: TenantServiceImpl
 * @projectName lins
 * @description: TODO
 * @date 2021/12/11 17:31
 */

@Service
public class SysTenantServiceImpl extends BaseServiceImpl<SysTenantMapper, SysTenant, SysTenantDto> implements SysTenantService {


    @Resource
    private ModelMapper modelMapper;

    @Override
    protected SysTenant toM(SysTenantDto sysTenantDTO) {
        SysTenant sysTenant = new SysTenant();
        sysTenant=modelMapper.map(sysTenantDTO,SysTenant.class);
        return sysTenant;
    }

    @Override
    protected SysTenantDto toD(SysTenant sysTenant) {
        return modelMapper.map(sysTenant,SysTenantDto.class);
    }
}
